<template>
    <div>
        <HelloWorld msg="蓝桥 前端实训案例" />
        <el-carousel  height="520px">
            <el-carousel-item v-for="(item,index) in imgPaths" :key="index">
                <!-- <h3 class="medium">{{ item }}</h3> -->
                <!-- <img :src="require('../assets/honorBg'+item+'.jpg')" style="width:auto;height: 500px;"> -->
                <img :src="item" style="max-width:1021px;height: auto;">
            </el-carousel-item>
        </el-carousel>
        
    </div>
</template>

<script>
import HelloWorld from '@/components/HelloWorld.vue'
export default {
    name: 'HomePageView',
    components: {
        HelloWorld
    },
    data() {
        return {
            tableData:'',
            imgPath: ['', 2, 3, 4],
            imgPaths: [
                require('../assets/honorBg.jpg'),
                require('../assets/honorBg2.jpg'),
                require('../assets/honorBg3.jpg'),
                require('../assets/honorBg4.jpg'),
            ]
        }
    },
    methods: {
        query() {
            fetch("http://47.241.102.141:3000/heros")
                .then((response) => response.json())
                .then((data) => {
                    this.tableData = data;
                });
        },
    },
}
</script>

<style>
.main {
    margin-top: 40px;
}

p {
    margin-top: 10px;
}

h3 {
    margin: 40px 0 0;
}

ul {
    list-style-type: none;
    padding: 0;
}

li {
    display: inline-block;
    margin: 0 10px;
}

a {
    color: #42b983;
}

.el-carousel {
    margin: 0 auto;
    max-width: 1021px;
}

.el-carousel__item h3 {
    color: #475669;
    font-size: 14px;
    opacity: 0.75;
    line-height: 200px;
    margin: 0;
}

.el-carousel__item:nth-child(2n) {
    background-color: #99a9bf;
}

.el-carousel__item:nth-child(2n+1) {
    background-color: #d3dce6;
}
</style>